﻿#region Copyright
// Copyright (c) 2011-2012 RaisingForce Team (Alikin Sergey)
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion

using System;
using System.Diagnostics.Contracts;

namespace RaisingForce.Raise.ObjectModel
{
    [ContractClassFor(typeof(IMeasureValue<IMeasure<int>, int, IMeasureValueContract>))]
    internal abstract class IMeasureValueContract :
        IMeasureValue<IMeasure<int>, int, IMeasureValueContract>
    {
        #region Constructors

        private IMeasureValueContract()
        { }

        #endregion

        #region IMeasureValue<int, IMeasure<int>> Members

        public abstract bool IsUnknown { get; }

        public abstract bool Equals(IMeasureValueContract other);

        public abstract int CompareTo(IMeasureValueContract other);

        public abstract int CompareTo(object obj);

        public abstract string ToString(string format, IFormatProvider formatProvider);

        public int Get(IMeasure<int> measure)
        {
            Contract.Requires(measure != null);
            Contract.Ensures(measure.ValueIsValid(Contract.Result<int>()));
            throw new NotSupportedException();
        }

        public string ToString(string format)
        {
            Contract.Ensures(Contract.Result<string>() != null);
            throw new NotSupportedException();
        }

        public string ToString(IFormatProvider formatProvider)
        {
            Contract.Ensures(Contract.Result<string>() != null);
            throw new NotSupportedException();
        }

        #endregion
    }
}
